<template>
  <div style="width: 60%;display:inline-block">
    <slot>
      <el-input
                :disabled="!editing"
                :model-value="copyProp" @input="$emit('update:copyProp', $event)"></el-input>
    </slot>
  </div>
  <div style="display:inline-block;width: 10%">
    <el-tag v-if="showTag!==undefined?showTag:( editing && originProp!==copyProp)"
            size="small"
            type="warning"
            closable @close="$emit('update:copyProp', originProp)"
    >发生修改
    </el-tag>
  </div>

</template>

<script setup>
import {inject} from "vue";

const out = defineProps(['originProp', 'copyProp', 'showTag']);
const editing = inject('editing',true)
const emit = defineEmits(['update:copyProp']);

</script>

<style scoped>

</style>